refactor: split browser and auth-proxy ingresses. - #586
Conversation
|
Claude finished @pantierra's task in 3m 8s —— View job Claude's Review
✅ No blocking issues — safe to merge. Both previously-requested changes are addressed:
Traced the refactor end-to-end (
Note: I wasn't able to execute Simplify (ponytail)
💰 Estimated review cost: $0.73 · 3m08s · 32 turns |
b2068f8 to
652a443
Compare
0c5165d to
c4bb6ea
Compare
364dceb to
81e90d4
Compare
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| path: /stac | ||
| - equal: | ||
| path: metadata.annotations["nginx.ingress.kubernetes.io/rewrite-target"] | ||
| value: /$2 |
There was a problem hiding this comment.
It seems that these notContains assertions can never fail without any: true
The assertion seems to pass even when the path is present, and fails correctly once any: true is added.
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| pathType: Prefix | ||
| path: /stac | ||
| backend: | ||
| service: | ||
| name: RELEASE-NAME-stac-auth-proxy | ||
| port: | ||
| number: 8080 | ||
| - contains: | ||
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| pathType: ImplementationSpecific | ||
| path: /browser(/|$)(.*) | ||
| backend: | ||
| service: | ||
| name: RELEASE-NAME-browser | ||
| port: | ||
| number: 8080 | ||
| path: /browser |
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| pathType: Prefix | ||
| path: /stac | ||
| backend: | ||
| service: | ||
| name: RELEASE-NAME-stac-auth-proxy | ||
| port: | ||
| number: 8080 | ||
| - contains: | ||
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| pathType: ImplementationSpecific | ||
| path: /browser(/|$)(.*) | ||
| backend: | ||
| service: | ||
| name: RELEASE-NAME-browser | ||
| port: | ||
| number: 8080 | ||
| path: /browser |
There was a problem hiding this comment.
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| pathType: Prefix | |
| path: /stac | |
| backend: | |
| service: | |
| name: RELEASE-NAME-stac-auth-proxy | |
| port: | |
| number: 8080 | |
| - contains: | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| pathType: ImplementationSpecific | |
| path: /browser(/|$)(.*) | |
| backend: | |
| service: | |
| name: RELEASE-NAME-browser | |
| port: | |
| number: 8080 | |
| path: /browser | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /stac | |
| any: true | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /browser | |
| any: true | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /browser(/|$)(.*) | |
| any: true |
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| path: "/browser" |
There was a problem hiding this comment.
Sane issue than https://github.com/developmentseed/eoapi-k8s/pull/586/changes#r3675257745
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: "/browser" | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: "/browser" | |
| any: true | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: "/browser(/|$)(.*)" | |
| any: true |
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| path: /stac |
There was a problem hiding this comment.
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /stac | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /stac | |
| any: true | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /stac(/|$)(.*) | |
| any: true |
| {{- $_ := set $annotations "traefik.ingress.kubernetes.io/router.entrypoints" ($root.Values.ingress.entrypoints | toString) -}} | ||
| {{- end -}} | ||
| {{- $annotations = mergeOverwrite $annotations ($root.Values.ingress.annotations | default dict) -}} | ||
| {{- $annotations = mergeOverwrite $annotations $owned -}} |
There was a problem hiding this comment.
While testing this branch with Claude it noticed that a user supplied traefik.ingress.kubernetes.io/router.middlewares in ingress.annotations can get silently dropped
To reproduce:
helm template eoapi charts/eoapi \
--set ingress.className=traefik \
--set browser.enabled=true --set raster.enabled=true \
--set 'ingress.annotations.traefik\.ingress\.kubernetes\.io/router\.middlewares=default-forward-auth@kubernetescrd'
| Ingress | router.middlewares value rendered |
|---|---|
| eoapi-browser-ingress | default-eoapi-browser-redirect-middleware@kubernetescrd |
| eoapi-ingress (main) | default-eoapi-strip-prefix-middleware@kubernetescrd |
default-forward-auth@kubernetescrd, the value set isn't in either one. It's not appended or merged, just replaced, with no warning 😬
Would it make sense to append instead of overwrite? e.g. in eoapi.ingressCommonAnnotations, just before the final merge:
{{- $mwKey := "traefik.ingress.kubernetes.io/router.middlewares" -}}
{{- if and (hasKey $annotations $mwKey) (hasKey $owned $mwKey) -}}
{{- $_ := set $owned $mwKey (printf "%s,%s" (get $annotations $mwKey) (get $owned $mwKey)) -}}
{{- end -}}
With that change, the same command renders:
| Ingress | router.middlewares value rendered |
|---|---|
| eoapi-browser-ingress | default-forward-auth@kubernetescrd,default-eoapi-browser-redirect-middleware@kubernetescrd |
| eoapi-ingress (main) | default-forward-auth@kubernetescrd,defauleware@kubernetescrd |
what do you think?
52bb6b6 to
a7e5d7d
Compare
a7e5d7d to
7fc2658
Compare
|
Thanks for the review, @lhoupert! I addressed the mentioned issues and cleaned up a bit more. I'd appreciate another round of review. |
7fc2658 to
c07ea81
Compare
b55d3fa to
c07ea81
Compare
Closes #568.